package com.guigu.www.luolujin.Conteoller;

import com.guigu.www.luolujin.Service.LljTemplateWholesomeDetailsService;
import com.guigu.www.pojo.PageVo;
import com.guigu.www.pojo.TemplateKeep;
import com.guigu.www.pojo.TemplateWholesomeDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 作者 罗露金
 */
@RestController
@RequestMapping("/LljTemplateWholesomeDetailsServlet")
public class LljTemplateWholesomeDetailsServlet {
    @Autowired
    LljTemplateWholesomeDetailsService service;
    @GetMapping()
    public PageVo<TemplateWholesomeDetails> pageTemKeep(Integer pageNum, Integer pageSize, String tempWhoDeName){
        return service.pageTemWholesomeDetails(pageNum, pageSize, tempWhoDeName);
    }
    @PostMapping
    public void insertTemKeep(@RequestBody TemplateWholesomeDetails templateWholesomeDetails){
        service.insertTemWholesomeDetails(templateWholesomeDetails);
    }
    @DeleteMapping("{id}")
    public void deleteTemKeep(@PathVariable("id") Integer tempWhoDeId){
        service.deleteTemWholesomeDetails(tempWhoDeId);
    }

    @PutMapping
    public void updateTemKeep(@RequestBody TemplateWholesomeDetails templateWholesomeDetails){
        service.updateTemWholesomeDetails(templateWholesomeDetails);
    }
    @GetMapping("{id}")
    public TemplateWholesomeDetails selectById(@PathVariable("id") Integer tempWhoDeId) {
        return service.selectById(tempWhoDeId);
    }
    @PutMapping("/state")
    public void upTemWholesomeDetails(Integer tempWhoDeId, Integer tempWhoDeState) {
        service.upTemWholesomeDetails(tempWhoDeId, tempWhoDeState);
    }
    @GetMapping("/all")
    public List<TemplateWholesomeDetails> queryAll() {
        return service.queryAll();
    }
}
